﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using com.zhongjh.Library.Common;

namespace com.zhongjh.Library.Database1
{
    internal class DbBase : IDbSvc, IDisposable
    {
        #region 字段

        internal CDbInfoEntity m_DbInfo = null;
        internal DbObjBase m_DbObj = null;
        
        #endregion //字段

        #region 构造函数

        public DbBase()
        {
        }

        public DbBase(CDbInfoEntity p_DbInfo)
        {
            m_DbInfo = p_DbInfo;
            m_DbObj = DbObjFactory.createDbObj(m_DbInfo);
        }

        #endregion //构造函数

        #region 公有方法

        public virtual bool QueryDbDataNoParameter(string p_strSql, ref DataTable p_dtResult) { return false; }

        //public virtual bool QueryDbDataNoParameter(string p_strSql, ref DataTable p_dtResult, ref Error Error) { return false; }

        public virtual bool ModifyDbDataNoParameter(string p_strSql) { return false; }

        //public virtual bool ModifyDbDataNoParameter(string p_strSql, ref Error Error) { return false; }

        public virtual bool QueryDbDataHasParameter(string p_strSql, IDataParameter[] p_idpDbParameter, ref DataTable p_dtResult) { return false; }

        //public virtual bool QueryDbDataHasParameter(string p_strSql, IDataParameter[] p_idpDbParameter, ref DataTable p_dtResult, ref Error Error) { return false; }

        public virtual bool ModifyDbDataHasParameter(string p_strSql, IDataParameter[] p_idpDbParameter) { return false; }

        //public virtual bool ModifyDbDataHasParameter(string p_strSql, IDataParameter[] p_idpDbParameter, ref Error Error) { return false; }

        public virtual bool QueryDBDataNoParameter_SP(string p_strSql, ref DataTable p_dtResult) { return false; }

        //public virtual bool QueryDBDataNoParameter_SP(string p_strSql, ref DataTable p_dtResult, ref Error Error) { return false; }

        public virtual bool ModifyDbDataNoParameter_SP(string p_strSql) { return false; }

        //public virtual bool ModifyDbDataNoParameter_SP(string p_strSql, ref Error Error) { return false; }

        public virtual bool QueryDBDataHasParameter_SP(string p_strSql, IDataParameter[] p_idpDbParameter, ref DataTable p_dtResult) { return false; }

        //public virtual bool QueryDBDataHasParameter_SP(string p_strSql, IDataParameter[] p_idpDbParameter, ref DataTable p_dtResult, ref Error Error) { return false; }

        public virtual bool ModifyDbDataHasParameter_SP(string p_strSql, IDataParameter[] p_idpDbParameter) { return false; }

        //public virtual bool ModifyDbDataHasParameter_SP(string p_strSql, IDataParameter[] p_idpDbParameter, ref Error Error) { return false; }

        public virtual bool BanthSave(DataSet p_dsData) { return false; }

        //public virtual bool BanthSave(DataSet p_dsData, ref Error Error) { return false; }

        public virtual void BeginTransaction() { }

        public virtual void CommitTransaction() { }

        public virtual void RollbackTransaction() { }

        public virtual void CloseConnection() { }

        public virtual IDataParameter[] CreateDataParameter(int p_intLength) { return null; }

        public virtual long GetSN(long p_lngCode) { return 0; }

        public virtual bool RecSN(long p_lngCode, long p_lngSn) { return false; }

        public void Dispose() { }

        #endregion //公有方法

        #region 私有方法

        #endregion //私有方法

    }
}
